4KHDR[磁].js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. var rule = {
  2. title: '4KHDR[磁]',
  3. host: 'https://www.4khdr.cn',
  4. homeUrl: "/forum.php?mod=forumdisplay&fid=2&page=1",
  5. url: '/forum.php?mod=forumdisplay&fid=2&filter=typeid&typeid=fyclass&page=fypage',
  6. filter_url: '{{fl.class}}',
  7. filter: {},
  8. searchUrl: '/search.php#searchsubmit=yes&srchtxt=**;post',
  9. searchable: 2,
  10. quickSearch: 1,
  11. filterable: 0,
  12. headers: {
  13. 'User-Agent': 'PC_UA',
  14. 'Cookie': 'http://127.0.0.1:9978/file:///tvbox/JS/lib/4khdr.txt',
  15. },
  16. timeout: 5000,
  17. class_name: "4K电影&4K美剧&4K华语&4K动画&4K纪录片&4K日韩印&蓝光电影&蓝光美剧&蓝光华语&蓝光动画&蓝光日韩印",
  18. class_url: "3&8&15&6&11&4&29&31&33&32&34",
  19. play_parse: true,
  20. play_json: [{
  21. re: '*',
  22. json: {
  23. parse: 0,
  24. jx: 0
  25. }
  26. }],
  27. lazy: '',
  28. limit: 6,
  29. 推荐: 'ul#waterfall li;a&&title;img&&src;div.auth.cl&&Text;a&&href',
  30. 一级: 'ul#waterfall li;a&&title;img&&src;div.auth.cl&&Text;a&&href',
  31. 二级: {
  32. title: "#thead_subject&&Text",
  33. img: "img.zoom&&src",
  34. desc: 'td[id^="postmessage_"] font&&Text',
  35. content: 'td[id^="postmessage_"] font&&Text',
  36. tabs: `js:
  37. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  38. TABS=[]
  39. let d = pdfa(html, 'div.pcb table.t_table a');
  40. let tabsa = [];
  41. let tabsq = [];
  42. let tabsm = false;
  43. let tabse = false;
  44. d.forEach(function(it) {
  45. let burl = pdfh(it, 'a&&href');
  46. if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
  47. tabsa.push("阿里雲盤");
  48. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  49. tabsq.push("夸克網盤");
  50. }else if (burl.startsWith("magnet")){
  51. tabsm = true;
  52. }else if (burl.startsWith("ed2k")){
  53. tabse = true;
  54. }
  55. });
  56. if (tabsm === true){
  57. TABS.push("磁力");
  58. }
  59. if (tabse === true){
  60. TABS.push("電驢");
  61. }
  62. if (false && tabsa.length + tabsq.length > 1){
  63. TABS.push("選擇右側綫路");
  64. }
  65. let tmpIndex;
  66. tmpIndex=1;
  67. tabsa.forEach(function(it){
  68. TABS.push(it + tmpIndex);
  69. tmpIndex = tmpIndex + 1;
  70. });
  71. tmpIndex=1;
  72. tabsq.forEach(function(it){
  73. TABS.push(it + tmpIndex);
  74. tmpIndex = tmpIndex + 1;
  75. });
  76. log('4khdr TABS >>>>>>>>>>>>>>>>>>' + TABS);
  77. `,
  78. lists: `js:
  79. log(TABS);
  80. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  81. LISTS = [];
  82. let d = pdfa(html, 'div.pcb table.t_table a');
  83. let lista = [];
  84. let listq = [];
  85. let listm = [];
  86. let liste = [];
  87. d.forEach(function(it){
  88. let burl = pdfh(it, 'a&&href');
  89. let title = pdfh(it, 'a&&Text');
  90. log('4khdr title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  91. log('4khdr burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  92. let loopresult = title + '$' + burl;
  93. if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
  94. if (true){
  95. if (TABS.length==1){
  96. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&confirm=0&url=" + encodeURIComponent(burl);
  97. }else{
  98. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl);
  99. }
  100. }else{
  101. burl = 'push://' + burl;
  102. }
  103. loopresult = title + '$' + burl;
  104. lista.push(loopresult);
  105. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  106. if (true){
  107. if (TABS.length==1){
  108. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
  109. }else{
  110. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
  111. }
  112. }else{
  113. burl = 'push://' + burl;
  114. }
  115. loopresult = title + '$' + burl;
  116. listq.push(loopresult);
  117. }else if (burl.startsWith("magnet")){
  118. listm.push(loopresult);
  119. }else if (burl.startsWith("ed2k")){
  120. liste.push(loopresult);
  121. }
  122. });
  123. if (listm.length>0){
  124. LISTS.push(listm);
  125. }
  126. if (liste.length>0){
  127. LISTS.push(liste);
  128. }
  129. if (false && lista.length + listq.length > 1){
  130. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  131. }
  132. lista.forEach(function(it){
  133. LISTS.push([it]);
  134. });
  135. listq.forEach(function(it){
  136. LISTS.push([it]);
  137. });
  138. `,
  139. },
  140. 搜索: `js:
  141. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  142. if (rule_fetch_params.headers.Cookie.startsWith("http")){
  143. rule_fetch_params.headers.Cookie=fetch(rule_fetch_params.headers.Cookie);
  144. let cookie = rule_fetch_params.headers.Cookie;
  145. setItem(RULE_CK, cookie);
  146. };
  147. log('4khdr search cookie>>>>>>>>>>>>>>>' + rule_fetch_params.headers.Cookie);
  148. let new_host= HOST + '/search.php';
  149. let new_html=request(new_host);
  150. let formhash = pdfh(new_html, 'input[name="formhash"]&&value');
  151. log("4khdr formhash>>>>>>>>>>>>>>>" + formhash);
  152. let params = 'formhash=' + formhash + '&searchsubmit=yes&srchtxt=' + encodeURIComponent(KEY);
  153. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  154. let postData = {
  155. body: params
  156. };
  157. Object.assign(_fetch_params, postData);
  158. log("4khdr search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  159. let search_html = post( HOST + '/search.php?mod=forum', _fetch_params)
  160. //log("4khdr search result>>>>>>>>>>>>>>>" + search_html);
  161. let d=[];
  162. let dlist = pdfa(search_html, 'div#threadlist ul li');
  163. dlist.forEach(function(it){
  164. let title = pdfh(it, 'h3&&Text');
  165. if (searchObj.quick === true){
  166. if (title.includes(KEY)){
  167. title = KEY;
  168. }
  169. }
  170. let img = "";
  171. let content = pdfh(it, 'p:eq(2)&&Text');
  172. let desc = pdfh(it, 'p:eq(3)&&Text');
  173. let url = pd(it, 'a&&href', HOST);
  174. d.push({
  175. title:title,
  176. img:img,
  177. content:content,
  178. desc:desc,
  179. url:url
  180. })
  181. });
  182. setResult(d);
  183. `,
  184. }